package com.spark.sparktest
import org.apache.spark.SparkContext
import org.apache.spark.SparkConf
object Test3 {
  def main(args: Array[String]) {

    val conf = new SparkConf().setAppName("ddd").setMaster("local[1]")
    var sc = new SparkContext(conf)
    val data = Array(1, 2, 3, 4, 5)
    val distData = sc.parallelize(data)
    var total = distData.reduce((a, b) => a + b)
    println(total)
    println()
    print(distData)
     println()
     
     val distFile = sc.textFile("data.txt")
     println(distFile)
     
    sc.stop()
    
    
  }
}